import { BaseLoader } from "./BaseLoader";
//class XMLLoader
    
    export  class XMLLoader extends BaseLoader
    {
       

        public get XMLData(): XML
        {
            return this._xml;
        }

        public /* override */ getClass(): Class
        {
            return XMLLoader;
        }

        public /* override */ initialize(arg1): void
        {
            var data;

            var loc1;
            data = arg1;
            if (!(data is flash.utils.ByteArray)) 
            {
                throw new Error("XMLResource can only initialize from "ByteArrays.");
            }
            try 
            {
                this._xml = new XML(data.toString());
                if (resourceInfo) 
                {
                    resourceInfo.data = this._xml;
                }
            }
            catch (e)
            {
                _valid = false;
            }
            onLoadCompleteHandler();
            return;
        }

        protected /* override */ onContentReady(arg1): Boolean
        {
            return this._valid;
        }

        private /* var */_valid: Boolean=true;

        private /* var */_xml: XML=null;
    }
